#define  _CRT_SECURE_NO_WARNINGS  1
#include <stdio.h>
int main()
{
	char a[20];
	char b[20];
	int n = 0;
	gets(a);
	scanf("%d", &n);
	int i = 0;
	for (i = 0; i < n; i++)
	{
		b[i] = a[i];
	}
	b[i] = '\0';
	puts(b);


	return 0;
}